package com.hudson.common.domain;

import com.hudson.common.enums.MessageTypeEnum;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/19 1:59
 **/
public class InnerMessage<T> {
    private static final InnerMessage<Object> SUCCESS = new InnerMessage(MessageTypeEnum.SUCCESS_MESSAGE.getType(), null);

    private String type;

    private T message;

    public InnerMessage(String type, T message) {
        this.type = type;
        this.message = message;
    }

    public static InnerMessage<Object> success() {
        return SUCCESS;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public T getMessage() {
        return message;
    }

    public void setMessage(T message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "Message{" +
                "type='" + type + '\'' +
                ", message=" + message +
                '}';
    }
}
